package chapter7;
import static utility.Print.*;

/**
 * Exercise 13: (2) Create a class with a method that is overloaded three times.
 * Inherit a new class, add a new overloading of the method, and show that all
 * four methods are available in the derived class.
 * 
 * @author rDiaconescu
 * 
 */

class BaseInteger {
	protected int i;

	public BaseInteger(int i) {
	    super();
	    this.i = i;
    }
	
	public void display() {
		print("" + i);
	}

	public void display(int j) {
		print("" + (i + j));
	}

	public void display(String s) {
		print(s + i);
	}

}

class ExtendedInteger extends BaseInteger{

	public void display(float f) {
		print("Extended integer display " + i);
	}
	public ExtendedInteger(int i) {
	    super(i);
	    // TODO Auto-generated constructor stub
    }
	
}

public class Exercise13 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		ExtendedInteger ei = new ExtendedInteger(2);
		ei.display();
		ei.display(2);
		ei.display("Message");
		
		ei.display((float)0);

	}

}
